from admin.settings.mysql.mysql_settings import mysql_auth
from admin.settings.mysql.MySQL_DB import DB_Connect

class User(object):

    def __init__(self):
        self.db_connect = DB_Connect(mysql_auth)


    def login(self, username, password):
        sql = '''
        select * from t_user where username = '%s' and password = '%s'
        ''' % (username, password)
        print(sql)

        data = self.db_connect.run_select_sql(sql)
        if len(data) == 0:
            return None
        return data[0]


    def test(self):
        str1 = "Test fangfa!!!!"
        return str1